﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>MLSMooc医学检验学慕课</title>
    <style>
        .text {
            border-bottom: #666 1px solid;
            border-left-width: 0px;
            border-right-width: 0px;
            border-top-width: 0px;
        }
    </style>
    <!-- CSS -->
   <link href="css/main.css" rel="stylesheet" />
    <link rel="stylesheet" href="../css/style.css" />
    <link rel="stylesheet" href="../css/clearfix.css" />

    <!-- /CSS -->
    <!--[if lt IE 9]>
        <script src="js/html5.js">IE7_PNG_SUFFIX=".png";</script>
    <![endif]-->
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script src="../jquerypdf/js/jquery.media.js"></script>
    <script src="../js/menu.js" type="text/javascript"></script>
    <script src="../js/footer.js" type="text/javascript"></script>
    <script src="../js/picture2.js" type="text/javascript"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/jzkszx.js"></script>
    <script src="../js/header.js" type="text/javascript"></script>
    <script>
        function MaxMe(o) {
            if (window.navigator.userAgent.indexOf("Firefox") > -1) {
                o.style.height = o.scrollTop + o.scrollHeight + "px";
            }
            else {
                if (o.scrollTop > 0) o.style.height = o.scrollTop + o.scrollHeight + "px";
            }
        }
    </script>
    
</head>
<body>
    <div class="go-top dn" id="go-top">
        <a href="javascript:;" class="go"></a>
    </div>
    <div class="allwraper"  >
        <div class="allcontainer clearfix">
            <div class="headerwraper"></div>

            <div class="containerwraper">
                <div class="noclor container" style="background-color: #bdbdbd;">
                    <div class="secmenu">
                        <ul class="menu">
                            <li class="home" onclick="location='../index.html'"><a>home</a></li>
                            <li class="small">
                                <a>课程目录</a>
                                <ul class="one" id="mainmenu">
                                </ul>
                            </li>
                        </ul>
                    </div>

                    <form id="form1" action="HandOnExam.aspx" method="post">
                    </form>


                    <div class="mainbox box-center">

                        <!--左侧-->
                        <div class="side_l left">
                            <!--信息-->
                            <div class="col-l-01 box-shadow-ie-r">
                                <b class="b1"></b><b class="b2"></b><b class="b3 "></b>
                                <div class=" bc bc-h01  box-shadow">
                                    <div class="text-left m5 col-r-03">
                                        <p>学员姓名：<span id="stuname">张翔</span></p>
                                        <p>卷面总分：<span id="totalscore">100.00</span>分</p>
                                    </div>
                                </div>
                                <b class="b3"></b><b class="b2"></b><b class="b1 "></b>
                            </div>
                            <!--序号-->
                            <div class="col-l-02 box-shadow-ie-r mt20 bc-h02  ">
                                <b class="b1"></b><b class="b2"></b><b class="b3 "></b>
                                <div class=" bc  box-shadow p10">
                                    <div id="testnum" class="xuhao">

                                    </div>
                                </div>
                                <b class="b3"></b><b class="b2"></b><b class="b1 "></b>
                            </div>
                            <!--<div class="toplogo">
                                <div class="mainbox">
                                    <div class="but"><a class="btn02 png" onclick="UpExam();" href="#"></a></div>
                                </div>
                            </div>-->
                        </div>
                        <!--右侧-->
                        <!--题-->
                        <div class="col-r-01 box-shadow-ie-r mt10 right">
                            <b class="b1"></b><b class="b2"></b><b class="b3 "></b>
                            <div id="Content1"></div>
                            <div id="Content" class=" bc bc-h04  box-shadow p10">

                            </div>
                        </div>
                    </div>
                    <input name="txtTimer" type="hidden" id="txtTimer" />
                    <input name="totaltime" type="hidden" id="totaltime" value="600" />
                    <input name="endtime" type="hidden" id="endtime" value="2015-05-31 16:50:52" />
                    <input name="HidhisID" type="hidden" id="HidhisID" value="185" />
                    </form>



                </div>
            </div>
        </div>
    </div>
   
    <div class="footerwraper">

    </div>

</body>

</html>
<script>
    $(function () {
        var res = window.location.search;
        var resdata = res.split(",")
        var uid;
        if (res == "") {

        } else {
            if (resdata.length <= 2) {
                uid = resdata[0].split("=")[1]
                prourlid = resdata[1].split("=")[1];
                GetExam(prourlid)
                GetExamitem(prourlid)
            }

        }
    })

    function GetExam(id) {

        var obj = {};
        obj.id = id
        $.ajax({
            url: '/Course/GetCourse1',
            type: 'get',
            data: obj,
            dataType: 'json',
            contentType: 'application/json',
            async: false,
            success: function (data) {
                var resultData = data;
                var strA = "1";
                var strB = "2";
                var strC = "3";
                var strD = "4";
                var strE = "5";
                if (resultData != undefined && resultData.length != 0) {
                    var Str = "";
                    if (resultData[0].t1 != 0) {
                        Str += '<b class="b1 bb1"></b><b class="b2 bb2"></b><b class="b3 bb2"></b><div class="bc bb2" ><div class="bt bb3 bc-h03"><span><a><img class="png" src="images/jian.png" /></a></span>第一部分：  单选题（每题1.00分,共' + (resultData[0].t1 * 1) + '分）</div></div ><b class="b3 bb2"></b><b class="b2 bb2"></b><b class="b1 bb1"></b>';
                        for (var i = 0; i < Object.keys(resultData).length; i++) {
                            if (resultData[i].TopicType == 1 && resultData[0].t1 != 0) {
                                Str += '<div class="m-choicebox" ><a name="' + (i + 1) + '" class="target"></a><h4>第  ' + (i + 1) + '  题：<p>' + resultData[i].Topic + '(　)。</p><p><img alt="" src="' + resultData[i].Img + '" /></p></h4><ul class="single"><li class="question-option-list"><span>A．</span><div class="option-content">' + resultData[i].OptionA + '</div></li><li class="question-option-list"><span>B．</span><div class="option-content">' + resultData[i].OptionB + '</div></li><li class="question-option-list"><span>C．</span><div class="option-content">' + resultData[i].OptionC + '</div></li><li class="question-option-list"><span>D．</span><div class="option-content">' + resultData[i].OptionD + '</div></li><li class="question-option-list"><span>E．</span><div class="option-content">' + resultData[i].OptionE + '<br/><br /></div></li ></ul><div class="m-checkBox single"><a  class="question-btn  ' + resultData[i].Id + '" id="lblA' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strA + ')"><label for="rdA' + resultData[i].Id + '"><input type="radio" value="' + resultData[i].OptionA + '"  name="rd' + resultData[i].Id + '"  id="rdA' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strA + ')" />&nbsp;&nbsp;A</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblB' + resultData[i].Id + '"><label for="rdB' + resultData[i].Id + '"><input type="radio" value="' + resultData[i].OptionB + '"  name="rd' + resultData[i].Id + '"  id="rdB' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strB + ')" />&nbsp;&nbsp;B</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblC' + resultData[i].Id + '"><label for="rdC' + resultData[i].Id + '"><input type="radio" value="' + resultData[i].OptionC + '"  name="rd' + resultData[i].Id + '"  id="rdC' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strC + ')" />&nbsp;&nbsp;C</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblD' + resultData[i].Id + '"><label for="rdD' + resultData[i].Id + '"><input type="radio" value="' + resultData[i].OptionD + '"  name="rd' + resultData[i].Id + '"  id="rdD' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strD + ')" />&nbsp;&nbsp;D</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblE' + resultData[i].Id + '"><label for="rdE' + resultData[i].Id + '"><input type="radio" value="' + resultData[i].OptionE + '"  name="rd' + resultData[i].Id + '"  id="rdE' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strE + ')" />&nbsp;&nbsp;E</label></a></div></div><div class="clearfix"></div>';
                            }
                        }
                    }
                    if (resultData[0].t2 != 0) {
                        Str += '<b class="b1 bb1"></b><b class="b2 bb2"></b><b class="b3 bb2"></b><div class="bc bb2" ><div class="bt bb3 bc-h03"><span><a ><img class="png" src="images/jian.png" /></a></span>第二部分：  多选题（每题2.00分,共' + (resultData[0].t2 * 2) + '分）</div></div ><b class="b3 bb2"></b><b class="b2 bb2"></b><b class="b1 bb1"></b>';
                        for (var i = 0; i < Object.keys(resultData).length; i++) {
                            if (resultData[i].TopicType == 2 && resultData[0].t2 != 0) {
                                Str += '<div class="m-choicebox" ><a name="' + (i + 1) + '" class="target"></a><h4>第  ' + (i + 1) + '  题：<p style="text-align:left;">' + resultData[i].Topic + '(　)。</p><p><img alt="" src="' + resultData[i].Img + '" /></p></h4><ul class="single"><li class="question-option-list"><span>A．</span><div class="option-content">' + resultData[i].OptionA + '</div></li><li class="question-option-list"><span>B．</span><div class="option-content">' + resultData[i].OptionB + '</div></li><li class="question-option-list"><span>C．</span><div class="option-content">' + resultData[i].OptionC + '</div></li><li class="question-option-list"><span>D．</span><div class="option-content">' + resultData[i].OptionD + '</div></li><li class="question-option-list"><span>E．</span><div class="option-content">' + resultData[i].OptionE + '<br/></div></li></ul><div class="m-checkBox single"><a  class="question-btn ' + resultData[i].Id + '" id="lblA' + resultData[i].Id + '"><label for="rdA' + resultData[i].Id + '"><input type="checkbox" value="' + resultData[i].OptionA + '"  name="rd' + resultData[i].Id + '"  id="rdA' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strA + ')" />&nbsp;&nbsp;A</label></a><a  class="question-btn ' + resultData[i].Id + '" id="lblB' + resultData[i].Id + '"><label for="rdB' + resultData[i].Id + '"><input type="checkbox" value="' + resultData[i].OptionB + '"  name="rd' + resultData[i].Id + '"  id="rdB' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strB + ')" />&nbsp;&nbsp;B</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblC' + resultData[i].Id + '"><label for="rdC' + resultData[i].Id + '"><input type="checkbox" value="' + resultData[i].OptionC + '"  name="rd' + resultData[i].Id + '"  id="rdC' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strC + ')" />&nbsp;&nbsp;C</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblD' + resultData[i].Id + '"><label for="rdD' + resultData[i].Id + '"><input type="checkbox" value="' + resultData[i].OptionD + '"  name="rd' + resultData[i].Id + '"  id="rdD' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strD + ')" /> &nbsp;&nbsp;D</label></a><a  class="question-btn  ' + resultData[i].Id + '" id="lblE' + resultData[i].Id + '"><label for="rdE' + resultData[i].Id + '"><input type="checkbox" value="' + resultData[i].OptionE + '"  name="rd' + resultData[i].Id + '"  id="rdE' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strE + ')" /> &nbsp;&nbsp;E</label></a></div></div><div class="clearfix"></div>';

                            }
                        }
                    }

                    if (resultData[0].t3 != 0) {
                        Str += '<b class="b1 bb1"></b><b class="b2 bb2"></b><b class="b3 bb2"></b><div class="bc bb2" ><div class="bt bb3 bc-h03"><span><a><img class="png" src="images/jian.png" /></a></span>第三部分：  判断题（每题1.00分,共' + (resultData[0].t3 * 1) + '分）</div></div ><b class="b3 bb2"></b><b class="b2 bb2"></b><b class="b1 bb1"></b>';
                        for (var i = 0; i < Object.keys(resultData).length; i++) {
                            if (resultData[i].TopicType == 3 && resultData[0].t3 != 0) {
                                Str += '<div class="m-choicebox" ><a name="21" class="target"></a><h4>第  ' + (i + 1) + '  题：<p>' + resultData[i].Topic + ' </p><p><img alt="" src="' + resultData[i].Img + '" /></p></h4><ul class="single"><li class="question-option-list"><span>A．</span><div class="option-content">正确</div></li><li class="question-option-list"><span>B．</span><div class="option-content">错误<br/></div></li></ul><div class="m-checkBox single"><a  class="question-btn ' + resultData[i].Id + '" id="lblA' + resultData[i].Id + '"><label for="rdA' + resultData[i].Id + '"><input type="radio" value="正确"  name="rd' + resultData[i].Id + '"  id="rdA' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strA + ')" /> &nbsp;&nbsp;A</label></a><a  class="question-btn ' + resultData[i].Id + '" id="lblB' + resultData[i].Id + '"><label for="rdB' + resultData[i].Id + '"><input type="radio" value="错误"  name="rd' + resultData[i].Id + '"  id="rdB' + resultData[i].Id + '" onclick="checkanswer(' + resultData[i].Id + ',' + resultData[i].TopicType + ',' + strB + ')" />&nbsp;&nbsp;B</label></a></div></div><div class="clearfix"></div>';
                            }
                        }
                    }

                    if (resultData[0].t4 != 0) {
                        Str += '<b class="b1 bb1"></b><b class="b2 bb2"></b><b class="b3 bb2"></b><div class="bc bb2" ><div class="bt bb3 bc-h03"><span><a><img class="png" src="images/jian.png" /></a></span>第四部分：  填空题（每题1.00分,共' + (resultData[0].t4 * 1) + '分,在一个填空里填写多个答案时 用（、）号隔开）</div></div ><b class="b3 bb2"></b><b class="b2 bb2"></b><b class="b1 bb1"></b>';
                        for (var i = 0; i < Object.keys(resultData).length; i++) {
                            if (resultData[i].TopicType == 4 && resultData[0].t4 != 0) {
                                var TitleStr = resultData[i].OptionTrue.split("(____)")
                                var optionstr = "&nbsp;&nbsp;&nbsp;&nbsp;";//填空题框架
                                for (var l = 0; l < TitleStr.length - 1; l++) {
                                    optionstr += "<b>" + TitleStr[l] + "</b><input class='.text' id='Option" + resultData[i].Id + "_" + (l + 1) + "' type='text' onchange='textchange(" + resultData[i].Id + "," + (l+1) + ")'>";
                                }

                                Str += '<div class="m-choicebox" ><a name="21" class="target"></a><h4>第  ' + (i + 1) + '  题：<p>请完成填空</p><p><img alt="" src="' + resultData[i].Img + '" /></p></h4><p>' + optionstr + '</p></div><div class="clearfix"></div>';
                            }
                        }
                    }
                    $("#Content").append(Str)
                    $("#stuname").text(sessionStorage.getItem("AdminName"))
                    $("#totalscore").text(Number(resultData[0].t1) + Number(resultData[0].t2) + Number(resultData[0].t3) + Number(resultData[0].t4))
                } else {
                    alert("本课程暂无习题")
                    location.href = "../index.html"
                }
            }
        })
    }
    function GetExamitem(id) {
        var obj = {};
        obj.id = id
        $.ajax({
            url: '/Course/GetCourse1',
            type: 'get',
            data: obj,
            dataType: 'json',
            contentType: 'application/json',
            async: false,
            success: function (data) {
                var resultData = data;
                var Str = "";
                if (resultData[0].t1 != 0) {
                    Str += '<h4>一、单选题</h4>';
                    for (var i = 0; i < Object.keys(resultData).length; i++) {
                        if (resultData[i].TopicType == 1) {
                            Str += ' <a href="#1" class="" id="num' + resultData[i].Id + '" name="num' + resultData[i].Id + '">' + (i + 1) + '</a>';
                        }
                    }
                    Str += '<div class="clearfix"></div>';
                }
                if (resultData[0].t2 != 0) {
                    Str += '<h4>二、多选题</h4>';
                    for (var i = 0; i < Object.keys(resultData).length; i++) {
                        if (resultData[i].TopicType == 2) {
                            Str += ' <a href="#2" class="" id="num' + resultData[i].Id + '" name="num' + resultData[i].Id + '">' + (i + 1) + '</a>';
                        }
                    }
                    Str += '<div class="clearfix"></div>';
                }
                if (resultData[0].t3 != 0) {
                    Str += '  <h4>三、判断题</h4>';
                    for (var i = 0; i < Object.keys(resultData).length; i++) {
                        if (resultData[i].TopicType == 3) {
                            Str += ' <a href="#3" class="" id="num' + resultData[i].Id + '" name="num' + resultData[i].Id + '">' + (i + 1) + '</a>';
                        }
                    }
                    Str += '<div class="clearfix"></div>';
                }

                if (resultData[0].t4 != 0) {
                    Str += '  <h4>四、填空题</h4>';
                    for (var i = 0; i < Object.keys(resultData).length; i++) {
                        if (resultData[i].TopicType == 4) {
                            Str += ' <a href="#4" class="" id="num' + resultData[i].Id + '" name="num' + resultData[i].Id + '">' + (i + 1) + '</a>';
                        }
                    }
                    Str += '<div class="clearfix"></div>';
                }

                $("#testnum").append(Str);
            }
        })
    }
    function GetExamInfo(uid,cid) {

    }
   
</script>
